#include "libCAN_defines.h"

#ifndef TELEMETRY_MANAGER_DEFINES_H
#define TELEMETRY_MANAGER_DEFINES_H

// A collection of all elements required for telemetry

typedef struct tagTELEMETRY_DATA
{
	unsigned int	byteSize;		// Size of the data
	unsigned int	identifier;		// Data identifier
	unsigned int	arrayOffset;	// Data array offset
	unsigned char*	pData;			// Pointer to the data or buffer
} TELEMETRY_DATA;


typedef struct tagTELEMETRY_LIST_ENTRY
{
	unsigned int 	identifier;		// Data identifier
	unsigned int 	arrayOffset;	// offset into the data array
} TELEMETRY_LIST_ENTRY;


#define TELEMETRY_LIST_COUNT 		3
#define TELEMETRY_POSTBOXES_MAX		2

// An list of pointers to ID_NULL terminated list of identifiers to send for telemetry
extern const TELEMETRY_LIST_ENTRY* ptelemetryLists[TELEMETRY_LIST_COUNT];

typedef struct tagTELEMETRY_AUTOREQUEST
{
	unsigned int autoRequestCounter	: 7;
	unsigned int requestFlag		: 1;
} TELEMETRY_AUTOREQUEST;

// A const list of request cycles requried to trigger each of the telemetry queues
extern const unsigned int telemetryAutoRequestCycles[TELEMETRY_LIST_COUNT];

typedef struct tagTELEMETRY_POSTBOX
{
	TELEMETRY_LIST_ENTRY	message;
	boolean					write;
} TELEMETRY_POSTBOX;


#endif
